# keysymdef.py - 键盘按键定义
# 包含常用的键盘按键及其对应的键码

keysymdef = [
    # 字母键 (大写和小写)
    ("a", 0x0061, 97), ("b", 0x0062, 98), ("c", 0x0063, 99), ("d", 0x0064, 100),
    ("e", 0x0065, 101), ("f", 0x0066, 102), ("g", 0x0067, 103), ("h", 0x0068, 104),
    ("i", 0x0069, 105), ("j", 0x006A, 106), ("k", 0x006B, 107), ("l", 0x006C, 108),
    ("m", 0x006D, 109), ("n", 0x006E, 110), ("o", 0x006F, 111), ("p", 0x0070, 112),
    ("q", 0x0071, 113), ("r", 0x0072, 114), ("s", 0x0073, 115), ("t", 0x0074, 116),
    ("u", 0x0075, 117), ("v", 0x0076, 118), ("w", 0x0077, 119), ("x", 0x0078, 120),
    ("y", 0x0079, 121), ("z", 0x007A, 122),
    ("A", 0x0041, 65), ("B", 0x0042, 66), ("C", 0x0043, 67), ("D", 0x0044, 68),
    ("E", 0x0045, 69), ("F", 0x0046, 70), ("G", 0x0047, 71), ("H", 0x0048, 72),
    ("I", 0x0049, 73), ("J", 0x004A, 74), ("K", 0x004B, 75), ("L", 0x004C, 76),
    ("M", 0x004D, 77), ("N", 0x004E, 78), ("O", 0x004F, 79), ("P", 0x0050, 80),
    ("Q", 0x0051, 81), ("R", 0x0052, 82), ("S", 0x0053, 83), ("T", 0x0054, 84),
    ("U", 0x0055, 85), ("V", 0x0056, 86), ("W", 0x0057, 87), ("X", 0x0058, 88),
    ("Y", 0x0059, 89), ("Z", 0x005A, 90),
    
    # 数字键
    ("0", 0x0030, 48), ("1", 0x0031, 49), ("2", 0x0032, 50), ("3", 0x0033, 51),
    ("4", 0x0034, 52), ("5", 0x0035, 53), ("6", 0x0036, 54), ("7", 0x0037, 55),
    ("8", 0x0038, 56), ("9", 0x0039, 57),
    
    # 功能键 F1-F24
    ("F1", 0xFFBE, 65470), ("F2", 0xFFBF, 65471), ("F3", 0xFFC0, 65472), ("F4", 0xFFC1, 65473),
    ("F5", 0xFFC2, 65474), ("F6", 0xFFC3, 65475), ("F7", 0xFFC4, 65476), ("F8", 0xFFC5, 65477),
    ("F9", 0xFFC6, 65478), ("F10", 0xFFC7, 65479), ("F11", 0xFFC8, 65480), ("F12", 0xFFC9, 65481),
    ("F13", 0xFFCA, 65482), ("F14", 0xFFCB, 65483), ("F15", 0xFFCC, 65484), ("F16", 0xFFCD, 65485),
    ("F17", 0xFFCE, 65486), ("F18", 0xFFCF, 65487), ("F19", 0xFFD0, 65488), ("F20", 0xFFD1, 65489),
    ("F21", 0xFFD2, 65490), ("F22", 0xFFD3, 65491), ("F23", 0xFFD4, 65492), ("F24", 0xFFD5, 65493),
    
    # 特殊键
    ("Space", 0x0020, 32), ("Return", 0xFF0D, 65293), ("Enter", 0xFF0D, 65293), ("Tab", 0xFF09, 65289), 
    ("BackSpace", 0xFF08, 65288), ("Backspace", 0xFF08, 65288), ("Escape", 0xFF1B, 65307), ("Esc", 0xFF1B, 65307),
    ("Delete", 0xFFFF, 65535), ("Del", 0xFFFF, 65535), ("Insert", 0xFF63, 65379), ("Ins", 0xFF63, 65379),
    ("Home", 0xFF50, 65360), ("End", 0xFF57, 65367), ("Page_Up", 0xFF55, 65365), ("PageUp", 0xFF55, 65365),
    ("Page_Down", 0xFF56, 65366), ("PageDown", 0xFF56, 65366), ("Print", 0xFF61, 65377), ("PrintScreen", 0xFF61, 65377),
    ("Scroll_Lock", 0xFF14, 65300), ("Pause", 0xFF13, 65299), ("Break", 0xFF6B, 65387),
    
    # 方向键
    ("Up", 0xFF52, 65362), ("Down", 0xFF54, 65364), ("Left", 0xFF51, 65361), ("Right", 0xFF53, 65363),
    ("UpArrow", 0xFF52, 65362), ("DownArrow", 0xFF54, 65364), ("LeftArrow", 0xFF51, 65361), ("RightArrow", 0xFF53, 65363),
    
    # 控制键
    ("Control_L", 0xFFE3, 65507), ("Control_R", 0xFFE4, 65508), ("Ctrl", 0xFFE3, 65507), ("Ctrl_L", 0xFFE3, 65507), ("Ctrl_R", 0xFFE4, 65508),
    ("Shift_L", 0xFFE1, 65505), ("Shift_R", 0xFFE2, 65506), ("Shift", 0xFFE1, 65505), ("Shift_L", 0xFFE1, 65505), ("Shift_R", 0xFFE2, 65506),
    ("Alt_L", 0xFFE9, 65513), ("Alt_R", 0xFFEA, 65514), ("Alt", 0xFFE9, 65513), ("Alt_L", 0xFFE9, 65513), ("Alt_R", 0xFFEA, 65514),
    ("Meta_L", 0xFFE7, 65511), ("Meta_R", 0xFFE8, 65512), ("Meta", 0xFFE7, 65511), ("Meta_L", 0xFFE7, 65511), ("Meta_R", 0xFFE8, 65512),
    ("Super_L", 0xFFEB, 65515), ("Super_R", 0xFFEC, 65516), ("Super", 0xFFEB, 65515), ("Super_L", 0xFFEB, 65515), ("Super_R", 0xFFEC, 65516),
    ("Hyper_L", 0xFFED, 65517), ("Hyper_R", 0xFFEE, 65518), ("Hyper", 0xFFED, 65517), ("Hyper_L", 0xFFED, 65517), ("Hyper_R", 0xFFEE, 65518),
    # Windows 键别名（更直观的名称）
    ("Win", 0xFFEB, 65515), ("Win_L", 0xFFEB, 65515), ("Win_R", 0xFFEC, 65516), ("Windows", 0xFFEB, 65515), 
    ("Windows_L", 0xFFEB, 65515), ("Windows_R", 0xFFEC, 65516), ("Cmd", 0xFFEB, 65515), ("Command", 0xFFEB, 65515),
    
    # 符号键
    ("period", 0x002E, 46), ("comma", 0x002C, 44), ("semicolon", 0x003B, 59), ("colon", 0x003A, 58),
    ("slash", 0x002F, 47), ("backslash", 0x005C, 92), ("minus", 0x002D, 45), ("equal", 0x003D, 61),
    ("bracketleft", 0x005B, 91), ("bracketright", 0x005D, 93), ("grave", 0x0060, 96), ("apostrophe", 0x0027, 39),
    ("quote", 0x0027, 39), ("quotedbl", 0x0022, 34), ("less", 0x003C, 60), ("greater", 0x003E, 62),
    ("question", 0x003F, 63), ("exclam", 0x0021, 33), ("at", 0x0040, 64), ("numbersign", 0x0023, 35),
    ("dollar", 0x0024, 36), ("percent", 0x0025, 37), ("asciicircum", 0x005E, 94), ("ampersand", 0x0026, 38),
    ("asterisk", 0x002A, 42), ("parenleft", 0x0028, 40), ("parenright", 0x0029, 41), ("underscore", 0x005F, 95),
    ("plus", 0x002B, 43), ("braceleft", 0x007B, 123), ("braceright", 0x007D, 125), ("bar", 0x007C, 124),
    ("asciitilde", 0x007E, 126),
    
    # 小键盘
    ("KP_0", 0xFFB0, 65456), ("KP_1", 0xFFB1, 65457), ("KP_2", 0xFFB2, 65458), ("KP_3", 0xFFB3, 65459),
    ("KP_4", 0xFFB4, 65460), ("KP_5", 0xFFB5, 65461), ("KP_6", 0xFFB6, 65462), ("KP_7", 0xFFB7, 65463),
    ("KP_8", 0xFFB8, 65464), ("KP_9", 0xFFB9, 65465), ("KP_Add", 0xFFAB, 65451), ("KP_Subtract", 0xFFAD, 65453),
    ("KP_Multiply", 0xFFAA, 65450), ("KP_Divide", 0xFFAF, 65455), ("KP_Enter", 0xFF8D, 65421), ("KP_Decimal", 0xFFAE, 65454),
    ("KP_Separator", 0xFFAC, 65452), ("KP_Equal", 0xFFBD, 65469), ("KP_Home", 0xFF95, 65379), ("KP_Left", 0xFF96, 65380),
    ("KP_Up", 0xFF97, 65381), ("KP_Right", 0xFF98, 65382), ("KP_Down", 0xFF99, 65383), ("KP_Prior", 0xFF9A, 65384),
    ("KP_Page_Up", 0xFF9A, 65384), ("KP_Next", 0xFF9B, 65385), ("KP_Page_Down", 0xFF9B, 65385), ("KP_End", 0xFF9C, 65386),
    ("KP_Begin", 0xFF9D, 65387), ("KP_Insert", 0xFF9E, 65388), ("KP_Delete", 0xFF9F, 65389),
    
    # 数字键盘运算符（常用别名）
    ("KP_Plus", 0xFFAB, 65451), ("KP_Minus", 0xFFAD, 65453), ("KP_Star", 0xFFAA, 65450), ("KP_Slash", 0xFFAF, 65455),
    ("KP_Period", 0xFFAE, 65454), ("KP_Comma", 0xFFAC, 65452),
    
    # 更多符号键
    ("minus", 0x002D, 45), ("equal", 0x003D, 61), ("plus", 0x002B, 43), ("asterisk", 0x002A, 42),
    ("slash", 0x002F, 47), ("backslash", 0x005C, 92), ("period", 0x002E, 46), ("comma", 0x002C, 44),
    ("semicolon", 0x003B, 59), ("colon", 0x003A, 58), ("apostrophe", 0x0027, 39), ("quotedbl", 0x0022, 34),
    ("grave", 0x0060, 96), ("bracketleft", 0x005B, 91), ("bracketright", 0x005D, 93), ("braceleft", 0x007B, 123),
    ("braceright", 0x007D, 125), ("bar", 0x007C, 124), ("asciitilde", 0x007E, 126), ("underscore", 0x005F, 95),
    ("less", 0x003C, 60), ("greater", 0x003E, 62), ("question", 0x003F, 63), ("exclam", 0x0021, 33),
    ("at", 0x0040, 64), ("numbersign", 0x0023, 35), ("dollar", 0x0024, 36), ("percent", 0x0025, 37),
    ("asciicircum", 0x005E, 94), ("ampersand", 0x0026, 38), ("parenleft", 0x0028, 40), ("parenright", 0x0029, 41),
    
    # 常用符号别名
    ("+", 0x002B, 43), ("-", 0x002D, 45), ("*", 0x002A, 42), ("/", 0x002F, 47), ("=", 0x003D, 61),
    (".", 0x002E, 46), (",", 0x002C, 44), (";", 0x003B, 59), (":", 0x003A, 58), ("'", 0x0027, 39),
    ("\"", 0x0022, 34), ("`", 0x0060, 96), ("[", 0x005B, 91), ("]", 0x005D, 93), ("{", 0x007B, 123),
    ("}", 0x007D, 125), ("|", 0x007C, 124), ("~", 0x007E, 126), ("_", 0x005F, 95), ("<", 0x003C, 60),
    (">", 0x003E, 62), ("?", 0x003F, 63), ("!", 0x0021, 33), ("@", 0x0040, 64), ("#", 0x0023, 35),
    ("$", 0x0024, 36), ("%", 0x0025, 37), ("^", 0x005E, 94), ("&", 0x0026, 38), ("(", 0x0028, 40),
    (")", 0x0029, 41),
    
    # 其他特殊键
    ("Caps_Lock", 0xFFE5, 65509), ("CapsLock", 0xFFE5, 65509), ("Num_Lock", 0xFF7F, 65407), ("NumLock", 0xFF7F, 65407),
    ("Scroll_Lock", 0xFF14, 65300), ("ScrollLock", 0xFF14, 65300),
] 